prometheus-node-exporter-lua: add newline to error messages
authorAmos Shapira <[email protected]>
Wed, 4 Jun 2025 08:54:11 +0000 (18:54 +1000)
committerEtienne Champetier <[email protected]>
Mon, 23 Jun 2025 06:56:01 +0000 (09:56 +0300)
Description:

1. Avoid error on nil value by skipping over it
2. Adds a newline to error messages

Signed-off-by: Amos Shapira <[email protected]>
[bump version]
Signed-off-by: Etienne Champetier <[email protected]>
utils/prometheus-node-exporter-lua/Makefile
utils/prometheus-node-exporter-lua/files/usr/bin/prometheus-node-exporter-lua

index 5d5bbf802e6b3396f0ad330073112c14dc25522c..134f8cfceb52d07fe549091deca9895bb8d46ceb 100644 (file)
@@ -4,7 +4,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=prometheus-node-exporter-lua
-PKG_VERSION:=2025.06.08
+PKG_VERSION:=2025.06.23
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Etienne CHAMPETIER <[email protected]>
index 36f064c5b4f111ab364b31e4b5ba4518439fffd4..f42595587c83b87a0705df57d5217bf0c1f8ed24 100755 (executable)
@@ -33,6 +33,9 @@ end
 
 function print_metric(metric, labels, value)
   local label_string = ""
+  if type(value) == "nil" then
+    return
+  end
   if labels then
     for label,value in pairs(labels) do
       label_string =  label_string .. label .. '="' .. value .. '",'
@@ -59,7 +62,7 @@ function timed_scrape(collector)
   local status, err = pcall(collector.scrape)
   if not status then
     success = 0
-    io.stderr:write(err)
+    io.stderr:write(err .. '\n')
   end
   return (socket.gettime() - start_time), success
 end